<script lang="ts" setup>


import { Page, useVbenModal } from '@vben/common-ui'
import {getUpRecord} from "#/api/goodsPurchase";
import type {VxeTableGridOptions} from "@vben/plugins/vxe-table";
import {useVbenVxeGrid} from "#/adapter/vxe-table";

const [Modal, modalApi] = useVbenModal({
  confirmText:'关闭',
  fullscreen: true,
  appendToMain: true,
  showCancelButton:false,
  onCancel() {
    modalApi.close()
  },
  async onConfirm() {
        modalApi.close()
  },
  onOpenChange: async (isOpen: boolean) => {
    if (!isOpen) return
    const { rowData } = modalApi.getData<Record<string, any>>()
      const  data  = await getUpRecord( {id:rowData})
    gridApi.setGridOptions({data:data})
    console.log(data)
  },
})

const gridOptions: VxeTableGridOptions = {
  columns: [

    { field: 'create_uid', title: '修改人', },
    { field: 'create_time', title: '修改时间', },
    { field: 'old_value', title: '修改前', },
    { field: 'new_value', title: '修改后', },
    { field: 'system_remark', title: '系统备注' },
  ],
  data: [],
  pagerConfig: {
    enabled: false,
  },
  sortConfig: {
    multiple: true,
  },
}
const [Grid, gridApi] = useVbenVxeGrid({ gridOptions })






</script>

<template>
  <Modal>

      <Grid/>

  </Modal>
</template>

<style scoped>
/* 让 Form.Item 不再有默认 margin-bottom */
.mb-0 {
  margin-bottom: 0 !important;
}
</style>
